﻿using System;

namespace Spring10Lab2P2
{
    public class MathLab2
    {
        //by Jordan
        public static double abs(double a)
        {
            double temp = a;
            if (temp < 0)
            {
                temp = temp * -1;
                return temp;
            }
            else { return temp; }
        }

        public static double pow(double a, int power)
        {
            if (power == 0)
            {
                return 1;
            }
            else if (power > 0)
            {
                return (a * pow(a, (power - 1)));
            }
            else if (power < 0)
            {
                return (a * pow(a, (power + 1)));
            }
            else
            {
                return 1;
            }
        }

        public static double toDegrees(double rad)
        {
           
            double retVal = rad * (180 / Math.PI);
           
            return retVal;
        }
    }
}
